import request from '../utils/request'


// 推荐
export function getRecommend() {
    return request({
        method: 'GET',
        url: '/recommend'
    })
}

// 排行榜
export function getRank() {
    return request({
        method: 'GET',
        url: '/rank'
    })
}

// 小说详情
export function getBookInfo(params) {
    return request({
        method: 'GET',
        url: '/searchBookinfo',
        params: params
    })
}

// 小说目录
export function getCatalog(params) {
    return request({
        method: 'GET',
        url: '/list',
        params
    })
}

// 获取分类
export function getCategory(params) {
    return request({
        method: 'GET',
        url: '/category',
        params
    })
}

// 获取章节内容
export function getContent(params) {
    return request({
        method: 'GET',
        url: '/text',
        params
    })
}

// 搜索小说
export function getSearch(params) {
    return request({
        url: '/search',
        params
    })
}

// 注册
export function regist(params) {
    return request({
        method: "post",
        url: '/regist',
        data: params
    })
}

// 登录
export function login(params) {
    return request({
        method: "post",
        url: '/login',
        data: params
    })
}

export function updateUser(params) {
    return request({
        method: "post",
        url: '/updateUser',
        data: params
    })
}

export function getBookCase(params){
    return request({
        method: 'GET',
        url: '/getBookCase',
        params
    })
}

export function updateBookCase(params) {
    return request({
        method: "post",
        url: '/updateBookCase',
        data: params
    })
}
